ddcd07508d95383a4ee572f88a32ed3d53ed8fb1,eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java,FindBugsWorker,getFilterPath,#String#IProject#,497
Before Change
public static IPath getFilterPath(String filePath, IProject project) {
IFile file = null;
IPath path = new Path(filePath);
if(path.segmentCount() == 1 && !path.isAbsolute()){
// pre - 1.3.8 code used file names only, see bug 2522989
file = project.getFile(filePath);
if(file != null && file.exists()){
After Change
*/
public static IPath getFilterPath(String filePath, IProject project) {
IPath path = new Path(filePath);
if(path.isAbsolute()) {
return path;
}
IPath wspLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation();
if(project == null) {
IPath newPath = wspLocation.append(path);
if(newPath.toFile().exists()){
return newPath;
}
} else {
// try first project relative location
IPath newPath = project.getLocation().append(path);
if(newPath.toFile().exists()){
return newPath;
}
// try to resolve relative to workspace (if we use workspace properties for project)
newPath = wspLocation.append(path);
if(newPath.toFile().exists()){
return newPath;
}
}
// something which we have no idea what it can be (or missing/wrong file path)